/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidades;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author 839398
 */
@Entity
@Table(name = "tbl_recaudo")
@NamedQueries({
    @NamedQuery(name = "TblRecaudo.findAll", query = "SELECT t FROM TblRecaudo t"),
    @NamedQuery(name = "TblRecaudo.findByCodRecaudo", query = "SELECT t FROM TblRecaudo t WHERE t.codRecaudo = :codRecaudo"),
    @NamedQuery(name = "TblRecaudo.findByExcedente", query = "SELECT t FROM TblRecaudo t WHERE t.excedente = :excedente"),
    @NamedQuery(name = "TblRecaudo.findByCantParticipantes", query = "SELECT t FROM TblRecaudo t WHERE t.cantParticipantes = :cantParticipantes"),
    @NamedQuery(name = "TblRecaudo.findByTotalGanado", query = "SELECT t FROM TblRecaudo t WHERE t.totalGanado = :totalGanado"),
    @NamedQuery(name = "TblRecaudo.findByGananciaParticipante", query = "SELECT t FROM TblRecaudo t WHERE t.gananciaParticipante = :gananciaParticipante")})
public class TblRecaudo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "cod_recaudo")
    private Integer codRecaudo;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "excedente")
    private BigDecimal excedente;
    @Basic(optional = false)
    @NotNull
    @Column(name = "cant_participantes")
    private short cantParticipantes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "total_ganado")
    private BigDecimal totalGanado;
    @Column(name = "ganancia_participante")
    private BigDecimal gananciaParticipante;
    @JoinColumn(name = "actividad", referencedColumnName = "cod_actividad")
    @ManyToOne(optional = false)
    private TblActividad actividad;

    public TblRecaudo() {
    }

    public TblRecaudo(Integer codRecaudo) {
        this.codRecaudo = codRecaudo;
    }

    public TblRecaudo(Integer codRecaudo, short cantParticipantes, BigDecimal totalGanado) {
        this.codRecaudo = codRecaudo;
        this.cantParticipantes = cantParticipantes;
        this.totalGanado = totalGanado;
    }

    public Integer getCodRecaudo() {
        return codRecaudo;
    }

    public void setCodRecaudo(Integer codRecaudo) {
        this.codRecaudo = codRecaudo;
    }

    public BigDecimal getExcedente() {
        return excedente;
    }

    public void setExcedente(BigDecimal excedente) {
        this.excedente = excedente;
    }

    public short getCantParticipantes() {
        return cantParticipantes;
    }

    public void setCantParticipantes(short cantParticipantes) {
        this.cantParticipantes = cantParticipantes;
    }

    public BigDecimal getTotalGanado() {
        return totalGanado;
    }

    public void setTotalGanado(BigDecimal totalGanado) {
        this.totalGanado = totalGanado;
    }

    public BigDecimal getGananciaParticipante() {
        return gananciaParticipante;
    }

    public void setGananciaParticipante(BigDecimal gananciaParticipante) {
        this.gananciaParticipante = gananciaParticipante;
    }

    public TblActividad getActividad() {
        return actividad;
    }

    public void setActividad(TblActividad actividad) {
        this.actividad = actividad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codRecaudo != null ? codRecaudo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TblRecaudo)) {
            return false;
        }
        TblRecaudo other = (TblRecaudo) object;
        if ((this.codRecaudo == null && other.codRecaudo != null) || (this.codRecaudo != null && !this.codRecaudo.equals(other.codRecaudo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + codRecaudo;
    }
    
}
